home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.20010306-20010921 / 000311_fdc@watsun.cc.columbia.edu_Tue Aug 14 10:51:39 EDT 2001.msg < prev    next >
Text File  |  2020-01-01  |  4KB  |  98 lines

  1. Article: 12670 of comp.protocols.kermit.misc
  2. Path: newsmaster.cc.columbia.edu!watsun.cc.columbia.edu!fdc
  3. From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
  4. Newsgroups: comp.protocols.kermit.misc
  5. Subject: Re: Kermit Scripts and Shell Scripts
  6. Date: 14 Aug 2001 14:51:02 GMT
  7. Organization: Columbia University
  8. Lines: 81
  9. Message-ID: <9lbdsm$35j$1@newsmaster.cc.columbia.edu>
  10. References: <336f652d.0108130841.43ce0ed5@posting.google.com> <9l909g$bse$1@newsmaster.cc.columbia.edu> <336f652d.0108140545.1a1c8658@posting.google.com>
  11. NNTP-Posting-Host: watsun.cc.columbia.edu
  12. X-Trace: newsmaster.cc.columbia.edu 997800662 3251 128.59.39.2 (14 Aug 2001 14:51:02 GMT)
  13. X-Complaints-To: postmaster@columbia.edu
  14. NNTP-Posting-Date: 14 Aug 2001 14:51:02 GMT
  15. Xref: newsmaster.cc.columbia.edu comp.protocols.kermit.misc:12670
  16.  
  17. In article <336f652d.0108140545.1a1c8658@posting.google.com>,
  18. Shifeux <shifeux@hotmail.com> wrote:
  19. : I am using:  C-Kermit 7.0.197, 8 Feb 2000, for Data General DG/UX
  20. : R4.20  I am trying to call the perl script from within an IF statement
  21. : using the "run" command (I also toyed around with "exec")  The perl
  22. : does work fine by itself. It seems like the IF construct is causing
  23. : the Kermit script to crash at the point of the run command. When I
  24. : comment out the IF statement the script runs fine.   I have tried
  25. : various different things but nothing will let this run command run.
  26. : Here is a listing of the latest try at the if statement.
  27. : if failure timeout
  28. : minput 10 {No files found} {Total of}
  29. : switch \v(minput) {
  30. :         :1, if failure write TRANSACTION-LOG Files Found\13\10, define
  31. : \%o 1, br
  32. : eak
  33. :         :2, cp /kermit_scripts/\%r.termlog
  34. : /cleoa+/kermit_scripts/\%r.files, break
  35. : }
  36. :             run /kermit_scripts/xxxxxxx.pl, pause 5, -
  37. :             define \%o 1, break
  38. : input 10 {choice : }
  39. : if failure timeout
  40. OK, this is all fractured and hard to read; I assume you're not trying to
  41. run a fractured original.
  42.  
  43. "run /kermit_scripts/xxxxxxx.pl" should work if the xxxxxxx.pl file contains
  44. a first line that looks like:
  45.  
  46. #!/usr/bin/perl
  47.  
  48. and it has execute permission:
  49.  
  50.  1. Can you run it from the shell prompt by typing its name?
  51.  
  52.  2. If so, can you run it from Kermit by typing
  53.     "run /kermit_scripts/xxxxxxx.pl" at the C-Kermit> prompt?
  54.  
  55. Assuming the answer to both is yes, let's try to reconstruct your
  56. fractured script:
  57.  
  58.   minput 10 {No files found} {Total of}
  59.   switch \v(minput) {
  60.     :1, if failure write TRANSACTION-LOG Files Found\13\10
  61.         define \%o 1
  62.         break
  63.     :2, cp /kermit_scripts/\%r.termlog /cleoa+/kermit_scripts/\%r.files
  64.         break
  65.   }
  66.   run /kermit_scripts/xxxxxxx.pl
  67.   pause 5
  68.   define \%o 1
  69.   break
  70.  
  71. Well, it's a bit confusing.  The RUN command looks like it should be
  72. a SWITCH clause (because of the BREAK) but it's outside the SWITCH
  73. statement.  What's the BREAK for?  And which IF statement are you talking
  74. about, that causes the script to crash?  The only one I see is the IF FAILURE
  75. in case 1 of the SWITCH (which doesn't make much sense).  Does the following
  76. make more sense?
  77.  
  78.   minput 10 {No files found} {Total of}
  79.   if failure stop 1 MINPUT timed out.
  80.  
  81.   switch \v(minput) {
  82.     :1, writeln TRANSACTION-LOG Files Not Found
  83.         define \%o 1
  84.         break
  85.     :2, cp /kermit_scripts/\%r.termlog /cleoa+/kermit_scripts/\%r.files
  86.         run /kermit_scripts/xxxxxxx.pl
  87.         pause 5
  88.         define \%o 1
  89.         break
  90.   }
  91.  
  92. - Frank
  93.